/*
 * Copyright (c) 2020, 2023, 3044483124@qq.com All rights reserved.
 *
 */
package itcast;

import java.time.LocalTime;

/**
 * <p>Project: JavaStudy - Ex1
 * <p>Powered by jiangbo On 2023-01-31
 * 16:27:36
 * <p>Created by IntelliJ IDEA
 *
 * @author jiangbo [3044483124@qq.com]
 * @version 1.0
 * @since 8/17
 */
public class Ex1 {
    public static void main(String[] args) {
//idea ctrl + d 复制一行
//idea shift + alt + up|down
//时间类、if分支语句
        var now = LocalTime.now();
//早上好 6-8 上午好 8-12 12-14 14-18 18-20 20-23
        int hour = now.getHour();
        if (hour >= 6 && hour < 8) {
            System.out.println("早上好");
        } else if (hour >= 8 && hour < 12) {
            System.out.println("上午好");
        } else if (hour >= 12 && hour < 14) {
            System.out.println("中午好");
        } else if (hour >= 14 && hour < 18) {
            System.out.println("下午好");
        } else if (hour >= 18 && hour < 21) {
            System.out.println("晚上好");
        }
    }
}


